import { getHttp, postHttp, deleteHttp } from "../utils/http"
const api = {
    getRoomList: (data) => {
        return getHttp("/houses", data);
    }, getRoomCondition: (data) => {
        return getHttp("/houses/condition", data);
    },
    getHousesDetail: (data) => {
        return getHttp("/houses/" + data.id);
    },
    //上传图片
    uploadImg: (data) => {
        return postHttp("/houses/image", data);
    },
    //获取发布房源信息
    getParams: (data) => {
        return getHttp("/houses/params", data);
    }
    ,
    //发布房源
    addRoom: (data) => {
        return postHttp("/user/houses", data);
    }
    ,
    //索搜小区名字
    searchCommunity: (data) => {
        return getHttp("/area/community", data);
    },
    //查看收藏
    //添加
    addFavorites: (data) => {
        return postHttp("/user/favorites/" + data.id);
    },
    //获取是否收藏
    getIsFavorites: (data) => {
        return getHttp(`/user/favorites${data.id ? "/" + data.id : ""}`);
    },
    //删除
    delFavorites: (data) => {
        return deleteHttp("/user/favorites/" + data.id)
    }

}
export default api;